/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.swta.freezay.database.dbEntities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Christian
 */
@Embeddable
public class ItemPackagePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "PACKAGE_ID")
    private int packageId;
    @Basic(optional = false)
    @Column(name = "ITEM_ID")
    private int itemId;

    public ItemPackagePK() {
    }

    public ItemPackagePK(int packageId, int itemId) {
        this.packageId = packageId;
        this.itemId = itemId;
    }

    public int getPackageId() {
        return packageId;
    }

    public void setPackageId(int packageId) {
        this.packageId = packageId;
    }

    public int getItemId() {
        return itemId;
    }

    public void setItemId(int itemId) {
        this.itemId = itemId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) packageId;
        hash += (int) itemId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemPackagePK)) {
            return false;
        }
        ItemPackagePK other = (ItemPackagePK) object;
        if (this.packageId != other.packageId) {
            return false;
        }
        if (this.itemId != other.itemId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "de.swta.freezay.database.dbEntities.ItemPackagePK[packageId=" + packageId + ", itemId=" + itemId + "]";
    }

}
